package com.example.demo;

import com.example.api.JobExecutor;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.json.JsonMapper;
import org.smartboot.http.server.HttpBootstrap;

/**
 * @author fanhang
 */
public class SmartHttpBoot {

    public static void main(String[] args) throws JsonProcessingException {
        JsonMapper jsonMapper = JsonMapper.builder().build();
        JobExecutor jobExecutor = new JobExecutor();

        SmartHttpHandler httpHandler = new SmartHttpHandler(jsonMapper, jobExecutor);

        HttpBootstrap bootstrap = new HttpBootstrap();
        bootstrap.configuration().debug(true);
        bootstrap.httpHandler(httpHandler).setPort(9090).start();
    }

}
